@extends('layouts.application')
@section('css')
    <link href="/vendor/css/imgbox.css" type="text/css" rel="stylesheet"/>
@endsection

@section('content')
    @include('shared._sidebar')

    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <h2 class="am-text-primary title_order">维权订单详情</h2>
            <hr>
            @include('shared._flash')
            <div class="am-panel am-panel-secondary">
                <div class="am-panel-hd">维权信息</div>
                <div class="am-panel-bd">
                    <ul class="detail_ul">
                        <li>
                            <span class="d1">商户ID：</span><span
                                    class="d2">{{$arbitration_detail['arbitration']['merchant_id']}}</span>
                        </li>
                        <li>
                            <span class="d1">订单ID：</span><span
                                    class="d2">{{$arbitration_detail['arbitration']['order_id']}}</span>
                        </li>
                        <li>
                            <span class="d1">期望退款额：</span><span
                                    class="d2">￥{{$arbitration_detail['arbitration']['expect_refund_amount']}}</span>
                        </li>
                        <li>
                            <span class="d1">维权结束时间：</span><span
                                    class="d2">{{date('Y-m-d H:i:s', $arbitration_detail['arbitration']['end_time'])}}</span>
                        </li>
                    </ul>
                </div>
            </div>

            <section class="am-panel am-panel-secondary">
                <header class="am-panel-hd">
                    <h3 class="am-panel-title">客服仲裁结果</h3>
                </header>
                <div class="am-panel-bd">
                    <ul class="detail_ul">
                        <li>
                            <span class="d1">仲裁结果：</span><span
                                    class="d2">{!! set_deal_result_status($arbitration_detail['arbitration']['merchant_id']) !!}</span>
                        </li>
                    </ul>
                </div>
            </section>

            <section class="am-panel am-panel-secondary" id="arbitration_container">
                <header class="am-panel-hd">
                    <h3 class="am-panel-title">维权说明<span class="am-icon-arrows-alt arrows am-topbar-right"
                                                         data-am-collapse="{parent: '#arbitration_container', target: '#arbitration'}"> 收起</span>
                    </h3>
                </header>

                <div class="am-panel-bd am-in" id="arbitration">
                    <ul class="am-comments-list am-comments-list-flip">

                        {{--发起维权--}}
                        <li class="am-comment am-comment-warning {!! set_arbitration_class($arbitration_detail['arbitration']['arbitration_user_type']) !!}">
                            <article class="am-comment">
                                    <span class="am-comment-avatar">
                                       {!! set_arbitration_type($arbitration_detail['arbitration']['arbitration_user_type']) !!}
                                    </span>

                                <div class="am-comment-main">
                                    <header class="am-comment-hd">
                                        <!--<h3 class="am-comment-title">评论标题</h3>-->
                                        <div class="am-comment-meta">
                                            <span class="am-comment-author"></span>
                                            发起维权于
                                            <time>{{date('Y-m-d H:i:s',$arbitration_detail['arbitration']['create_time'])}}</time>
                                        </div>
                                    </header>

                                    <div class="am-comment-bd">
                                        <p>
                                            维权原因：{!! set_arbitration_reason($arbitration_detail['arbitration']['arbitration_reason_type']) !!}</p>
                                        <p>
                                            维权描述：{!! $arbitration_detail['arbitration']['arbitration_description'] !!}</p>
                                        <p>维权凭证：</p>
                                        <a class="img_box" href="/amazeui/assets/i/startup-640x1096.png"><img class="thumb" src="/amazeui/assets/i/startup-640x1096.png"/></a>
                                    </div>
                                </div>
                            </article>
                        </li>

                        {{--循环追加维权--}}
                        @foreach($arbitration_detail['addto_list'] as $addto_list)
                            <li class="am-comment {!! set_arbitration_add_class($addto_list['addto_user_type']) !!}">
                                <article class="am-comment">
                                    <span class="am-comment-avatar">
                                      {!! set_arbitration_type($addto_list['addto_user_type']) !!}
                                    </span>

                                    <div class="am-comment-main">
                                        <header class="am-comment-hd">
                                            <!--<h3 class="am-comment-title">评论标题</h3>-->
                                            <div class="am-comment-meta">
                                                <span class="am-comment-author">ID：{{$addto_list['service_user_id']}}</span>
                                                追加维权于
                                                <time>{{date('Y-m-d H:i:s',$addto_list['create_time'])}}</time>
                                            </div>
                                        </header>

                                        <div class="am-comment-bd">
                                            @if($addto_list['addto_user_type']==3)
                                                <p>
                                                    是否同意维权：<span class="arrows">{!! set_deal_result_status($addto_list['is_agree']) !!}</span>
                                                </p>
                                            @endif
                                            <p>维权说明：{!! $addto_list['addto_explians'] !!}</p>
                                            维权凭证：
                                            <br/>
                                            <a class="img_box" href="/amazeui/assets/i/startup-640x1096.png"><img class="thumb" src="/amazeui/assets/i/startup-640x1096.png"/></a>
                                        </div>
                                    </div>
                                </article>
                            </li>
                        @endforeach
                    </ul>
                </div>
            </section>

            <section class="am-panel am-panel-secondary">
                <header class="am-panel-hd">
                    <h3 class="am-panel-title">客服仲裁</h3>
                </header>
                <div class="am-panel-bd">
                    <form class="am-form" method="post"
                          action="{{route('order.arbitration.servicedeal',$arbitration_detail['arbitration']['id'])}}">
                        {{ csrf_field() }}
                        {{ method_field('POST') }}

                        <div class="am-g">
                            <div class="am-u-sm-2">
                                <label for="">处理维权</label>
                                <select data-am-selected name="is_agree">
                                    <option selected>仲裁订单</option>
                                    <option value="0">不同意维权，交易成功！</option>
                                    <option value="1">同意维权，退款！</option>
                                </select>
                            </div>
                        </div>

                        <div class="am-form-group">
                            <div class="am-u-sm-12">

                                <label for="doc-ta-1">仲裁描述</label>
                                <textarea class="" cols="50" rows="10" id="doc-ta-1" name="addto_explians"></textarea>
                            </div>
                        </div>

                        <div class="am-u-sm-12">
                            <button type="submit" class="am-btn am-btn-default">提交</button>
                        </div>

                    </form>
                </div>
            </section>

        </div>
    </div>


    <!-- content end -->

@endsection

@section('js')
    <script src="/vendor/js/jquery.min.js"></script>
    <script src="/vendor/js/imgbox.js"></script>
    <script>
        $(function () {

            //折叠面板
            $(".am-icon-arrows-alt").click(function () {
                var arrows = $(this).attr('class');
                if (arrows.indexOf("am-collapsed") > 0) {
                    $(this).text(' 收起');
                } else {
                    $(this).text(' 展开');
                }
            })

            //缩略图放大

            $(".img_box").imgbox();


        })
    </script>
@endsection


